<div class="tabbable tabs-left">
              <ul class="nav nav-tabs">
              	<li><h5><?php echo $this->translate('积分类型信息'); ?></h5></li>
                <li class="active"><a data-toggle="tab" href="#integral_edit"><?php echo $this->translate('基本信息'); ?></a></li>
              </ul>
              <form class="form-horizontal" method="post" name="integral_type_form" id="integral_type_form" action="">
              <input type="hidden" name="integral_type_id" id="integral_type_id" value="<?php echo ($this->integralTypeInfo ? $this->integralTypeInfo->integral_type_id : ''); ?>" />
              <div class="tab-content">
    			<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        			<div class="pull-left" style="font-size:16px;line-height:30px;"><strong><?php echo $this->translate('编辑积分类型'); ?></strong></div>
        			<div id="sticky_navigation_right" class="pull-right">
                	<a href="<?php echo $this->url('integral/default',array('action'=>'integralType')); ?>" class="btn btn-small"><i class="icon-arrow-left"></i> <?php echo $this->translate('返回积分类型列表'); ?></a>&nbsp;
                	<a href="<?php echo $this->serverUrl(true); ?>" class="btn btn-small btn-warning"><i class="icon-repeat icon-white"></i> <?php echo $this->translate('刷新'); ?></a>&nbsp;
                	<button type="submit" class="btn btn-small btn-primary"><i class="icon-ok icon-white"></i> <?php echo $this->translate('保存积分类型'); ?></button>&nbsp;
                	<a href="<?php echo $this->myviewalias()->dbshopHelpUrl('user_integral_type'); ?>" target="_blank" class="btn btn-small btn-info"><i class="icon-info-sign icon-white"></i> <?php echo $this->translate('查看帮助说明'); ?></a>
                	</div>
        		</div>
                <div id="integral_edit" class="tab-pane active">
                	<div class="well admin_add_header_well"><?php echo $this->translate('基本信息'); ?></div>
                	<div class="well admin_add_well">
                        <div class="message_one">
                    	</div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('类型名称'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" id="integral_type_name" readonly disabled name="integral_type_name" value="<?php echo ($this->integralTypeInfo ? $this->escapeHtml($this->integralTypeInfo->integral_type_name) : ''); ?>" class="span3">
            				</div>                        
                        </div>
						<div class="control-group">
							<label for="input01" class="control-label"><?php echo $this->translate('积分换算比例'); ?><span class="must_add_value">*</span>：</label>
							<div class="controls">
								<?php if($this->integralTypeInfo->integral_type_mark == 'integral_type_1') { ?>
									<input type="text" id="integral_currency_con"  name="integral_currency_con" value="<?php echo ($this->integralTypeInfo ? $this->integralTypeInfo->integral_currency_con : 1); ?>" class="span2">
									<?php echo $this->translate('每100积分可以抵多少元(基础货币)'); ?>
								<?php } else { ?>
									<input type="text" value="<?php echo $this->translate('只有消费积分可以设置'); ?>" readonly disabled class="span2">
								<?php } ?>
							</div>
						</div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('初始积分数'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" id="default_integral_num"  name="default_integral_num" value="<?php echo ($this->integralTypeInfo ? $this->integralTypeInfo->default_integral_num : 0); ?>" class="span2">
            				</div>                        
                        </div>
                  	</div>
                </div>
              
             </div>
              </form>
</div>
<script>
$(document).ready(function() {
	$("#integral_type_form").validate({
		rules: {
			integral_type_name: {
				required: true
			},
			<?php if($this->integralTypeInfo->integral_type_mark == 'integral_type_1') { ?>
			integral_currency_con: {
				required: true,
				digits: true,
				min:1
			},
			<?php } ?>
			default_integral_num: {
				required: true,
				number: true,
				min:0
			}
		},
		messages: {
			integral_type_name: {
				required: "<?php echo $this->translate('积分类型名称不能为空！'); ?>"
			},
			<?php if($this->integralTypeInfo->integral_type_mark == 'integral_type_1') { ?>
			integral_currency_con: {
				required: "<?php echo $this->translate('积分换算比例不能为空！'); ?>",
				digits: "<?php echo $this->translate('积分换算比例必须为正整数！'); ?>",
				min:"<?php echo $this->translate('积分换算比例最小为1'); ?>"
			},
			<?php } ?>
			default_integral_num: {
				required: "<?php echo $this->translate('初始积分数不能为空！'); ?>",
				number: "<?php echo $this->translate('初始积分数必须为数字！'); ?>",
				min:"<?php echo $this->translate('初始积分数最小为0'); ?>"
			}
		}
	});
});

<?php if ($this->success_msg != '') { ?>
show_message('.message_one','<?php echo date("Y-m-d H:i:s"); ?>','<?php echo $this->success_msg; ?>','alert-success');
<?php } ?>

</script>
